﻿using SaaS.Model.Entity.Blogs;
using SaaS.Model.Dto.Blogs;
using System;
using System.Collections.Generic;
using System.Text;
using XCore.Dapper;
using XCore.Dependency;

namespace Web.System.Services.Blogs
{
    public class MenuAppService : SystemApplicationServiceBase, ITransientDependency
    {
        public bool Sort(int id, int value)
        {
            using (IDapperDatabase dapper = CreateDapperDatabase())
            {
                return dapper.Execute($"update blog_menus set sort+={value} where id={id}");
            }
        }

        public bool Visble(int id)
        {
            using (IDapperDatabase dapper = CreateDapperDatabase())
            {
                return dapper.Execute($"update Blog_Menus set isvisble=~isvisble where id={id}");
            }
        }
    }
}
